package com.lcm.springcloud.controller;

import com.lcm.springcloud.common.ResultBean;
import com.lcm.springcloud.service.PaymentFeignService;
import com.lcm.springcloud.vo.PaymentVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: Coder-Lcm
 * @date: 2020/10/28 17:03
 */
@RestController
public class OrderFeignController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/payment/{id}")
    public ResultBean<PaymentVO> getPaymentById(@PathVariable("id") Long id) {
        return paymentFeignService.findById(id);
    }

    @GetMapping("/consumer/payment/feign/timeout")
    public String paymentFeignTimeout(){
        //openfeign-ribbon，客户端默认等待1秒钟
        return paymentFeignService.paymentFeignTimeout();
    }

}
